@extends('admin.common.admin_main')
@section('container')
<div class="uc-body">
    <div class="uc-head">
        <ul>
            <li><span class="sel">服务商认证</span></li>
            <li><a href="/user/company?type=2">业主认证</a></li>
        </ul>
    </div>
    <div class="form form-table">
        <div class="form-body">
            <div class="row">
                <label class="col-1 control-label request-label" for="company_name">单位名称</label>
                <div class="col-3">
                    <input id="company_name" class="form-control" type="text"><span style="line-height: 34px;display: none;" id="company_exists_area" ><a target="_blank" id="company_exists_url">公司已存在，点此查看</a></span>
                </div>
                <label class="col-1 control-label" for="company_type_id">单位性质</label>
                <div class="col-3">
                    <select class="form-control" id="company_type_id">
                        <option value="">请选择</option>
                        @forelse ($company_type_list as $key=>$value)
                            <option value="{{$key}}">{{$value}}</option>
                        @empty
                        @endforelse
                    </select>
                </div>
                <label class="col-1 control-label">单位Logo</label>
                <div class="col-3 j_fileUpload">
                    <div class="static fl">
                        <a class="j_fileUrl"></a>
                    </div>
                    <div class="file_select">
                        <div class="static">
                            <a class="btn btn-small btn-primary j_fileTxt" data-txt="上传文件">上传文件</a>
                            <input class="txt_file j_fileSelect" name="files" type="file" id="logo_info">
                            <input class="j_name" type="hidden" id="logo_img_name">
                            <input class="j_url" type="hidden" id="logo_img_url">
                            <input class="j_md5" type="hidden" id="logo_img_md5">
                            <input class="j_thumbUrl" type="hidden" id="logo_img_thumbUrl">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label" for="legan_user_name">法人代表</label>
                <div class="col-3">
                    <input class="form-control" type="text" id="legan_user_name">
                </div>
                <label class="col-1 control-label" for="legan_user_phone">联系电话</label>
                <div class="col-3">
                    <input class="form-control" type="text" id="legan_user_phone">
                </div>
                <label class="col-1 control-label" for="legan_user_email">联系邮箱</label>
                <div class="col-3">
                    <input class="form-control" type="text" id="legan_user_email">
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label" for="company_regist_date">注册时间</label>
                <div class="col-3">
                    <input class="form-control j_dateSelect" type="text" readonly id="company_regist_date">
                </div>
                <label class="col-2 control-label" for="bank_level_id">银行信用等级</label>
                <div class="col-2">
                    <select id="bank_level_id" class="form-control">
                        <option value="">请选择</option>
                        @forelse ($bank_level_list as $key=>$value)
                            <option value="{{$key}}">{{$value}}</option>
                        @empty
                        @endforelse
                    </select>
                </div>
                <label class="col-1 control-label" for="zip_code">邮编</label>
                <div class="col-3">
                    <input class="form-control" type="text" id="zip_code">
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label" for="company_regist_money">注册资本</label>
                <div class="col-3">
                    <input class="form-control form-control-sm" type="text" placeholder="万元" id="company_regist_money">
                    <select id="company_regist_money_type" class="form-control">
                        <option value="1">人民币</option>
                        <option value="2">美元</option>
                    </select>
                </div>
                <label class="col-1 control-label" for="all_money">资产总额</label>
                <div class="col-3">
                    <input id="all_money" class="form-control" type="text" placeholder="万元">
                </div>
                <label class="col-1 control-label" for="earn_money">净资产</label>
                <div class="col-3">
                    <input id="earn_money" class="form-control" type="text" placeholder="万元">
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label" for="reg_province">注册地址</label>
                <div class="col-11">
                    <select class="form-control" id="reg_province">
                        <option value="">请选择</option>
                        @forelse ($province_list as $key=>$value)
                            <option value="{{$value['id']}}">{{$value['name']}}</option>
                        @empty
                        @endforelse
                    </select>
                    <select class="form-control" id="reg_city">
                        <option value="">请选择</option>
                    </select>
                    <select class="form-control" id="reg_district">
                        <option value="">请选择</option>
                    </select>
                    <input class="form-control" size="60" type="text" placeholder="" id="company_regist_address">
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label request-label" for="contact_user_name">联系人</label>
                <div class="col-3">
                    <input class="form-control" type="text" placeholder="" id="contact_user_name">
                </div>
                <label class="col-1 control-label request-label">联系手机</label>
                <div class="col-3">
                    <input class="form-control" type="text" placeholder="" id="contact_user_phone">
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label">固定电话</label>
                <div class="col-3">
                    <input class="form-control" type="text" placeholder="含区号" id="fix_phone">
                </div>
                <label class="col-1 control-label">传真号码</label>
                <div class="col-3">
                    <input class="form-control" type="text" placeholder="含区号" id="fix_number">
                </div>
                <label class="col-1 control-label request-label">Email</label>
                <div class="col-3">
                    <input class="form-control" type="text" placeholder="" id="contact_user_email">
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label request-label">通信地址</label>
                <div class="col-11">
                    <select id="contact_province" class="form-control">
                        <option value="">请选择</option>
                        @forelse ($province_list as $key=>$value)
                            <option value="{{$value['id']}}">{{$value['name']}}</option>
                        @empty
                        @endforelse
                    </select>
                    <select class="form-control" id="contact_city">
                        <option value="">请选择</option>
                    </select>
                    <select class="form-control" id="contact_district">
                        <option value="">请选择</option>
                    </select>
                    <input class="form-control" size="60" type="text" placeholder="" id="contact_user_address">
                </div>
            </div>
            <div class="j_selectPane">
                <div class="row">
                    <label class="col-1 control-label request-label">涉及领域</label>
                    <div class="col-11">
                        <a class="btn btn-primary j_setDomain">设置</a>
                        <div class="domain j_domainItems">

                        </div>
                    </div>
                    {{-- <div class="col-10">
                        <div class="select-pane j_selectItems">
                            <ul class="val">

                            </ul>
                        </div>
                    </div> --}}
                </div>
{{--                 <div class="row">
                    <div class="col-offset-1 col-10">
                        <select class="form-control" id="domain_change">
                            @forelse ($domain1_list as $key=>$value)
                                <option value="{{$value['id']}}">{{$value['name']}}</option>
                            @empty
                            @endforelse
                        </select>
                        <select class="form-control">
                            @forelse ($domain2_list as $key=>$value)
                                <option value="{{$value['id']}}">{{$value['name']}}</option>
                            @empty
                            @endforelse
                        </select>
                        <button class="btn btn-primary j_selectBtn" type="button" data-name="company_domain">添加</button>
                    </div>
                </div> --}}
            </div>
            <div class="row domain_tech_flag">
                <label class="col-1 control-label ">技术路径</label>
                <div class="col-11">
                    <a class="btn btn-primary j_setPath">设置</a>
                </div>

{{--                 <label class="col-1 control-label">主要服务模式</label>
                <div class="col-2">
                    <select id="company_service_type_id" class="form-control">
                        <option value="">请选择</option>
                        @forelse ($service_type_list as $key=>$value)
                            <option value="{{$key}}">{{$value}}</option>
                        @empty
                        @endforelse
                    </select>
                </div> --}}

            </div>
            <div class="row domain_tech_flag">
                <label class="col-1 control-label">服务能力</label>
                <div class="col-11">
                    <table class="v3-table v3-table_tech j_techService" style="display: none">
                        <thead>
                        <tr>
                            <th>技术路径名称</th>
                            <th>评估咨询</th>
                            <th>方案设计</th>
                            <th>建设实施</th>
                            <th>运维</th>
                            <th>设备供应</th>
                            <th>其他</th>
                        </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="row">
                <label class="col-1 control-label">职工总数</label>
                <div class="col-2">
                    <input id="stuff_num" class="form-control" type="text" placeholder="">
                </div>
                <label class="col-2 control-label">工程技术人员</label>
                <div class="col-2">
                    <input id="tech_num" class="form-control" type="text" placeholder="">
                </div>
            </div>

            <div class="row">
                <label class="col-1 control-label">主要业务</label>
                <div class="col-10">
                    <textarea id="major_business" class="form-control form-control-text"></textarea>
                </div>
            </div>
            <div class="j_selectPane">
                <div class="row">
                    <label class="col-1 control-label">服务领域</label>
                    <div class="col-10">
                        <div class="select-pane j_selectItems">
                            <ul class="val">

                            </ul>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-offset-1 col-10">
                        <select class="form-control">
                            <option value="">请选择</option>
                            @forelse ($service_domain_list as $key=>$value)
                                <option value="{{$value['id']}}">{{$value['name']}}</option>
                            @empty
                            @endforelse
                        </select>
                        <button class="btn btn-primary j_selectBtn" type="button" data-name="service_domain">添加</button>
                    </div>
                </div>
            </div>
            <div class="j_selectPane">
                <div class="row">
                    <label class="col-2 control-label">实施推广能力及方式</label>
                    <div class="col-10">
                        <div class="select-pane j_selectItems">
                            <ul class="val">

                            </ul>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-offset-1 col-10">
                        <select class="form-control">
                            <option value="">请选择</option>
                            @forelse ($method_list as $key=>$value)
                                <option value="{{$value['id']}}">{{$value['name']}}</option>
                            @empty
                            @endforelse
                        </select>
                        <button class="btn btn-primary j_selectBtn" type="button" data-name="method">添加</button>
                    </div>
                </div>
            </div>
            <div class="row">
                <label class="col-2 control-label">组织机构代码</label>
                <div class="col-4">
                    <input id="organize_code" class="form-control" size="40" type="text">
                </div>
                <label class="col-3 control-label">组织机构代码（扫描件）</label>
                <div class="col-3 j_fileUpload">
                    <div class="static fl">
                        <a class="j_fileUrl"></a>
                    </div>
                    <div class="file_select">
                        <div class="static">
                            <a class="btn btn-small btn-primary j_fileTxt" data-txt="上传文件">上传文件</a>
                            <input class="txt_file j_fileSelect" name="files" type="file" id="organize_info">
                            <input class="j_name" type="hidden" id="organize_img_name">
                            <input class="j_url" type="hidden" id="organize_img_url">
                            <input class="j_md5" type="hidden" id="organize_img_md5">
                            <input class="j_thumbUrl" type="hidden" id="organize_img_thumbUrl">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <label class="col-2 control-label">营业执照注册号</label>
                <div class="col-4">
                    <input id="organize_regist_number" class="form-control" size="40" type="text">
                </div>
                <label class="col-3 control-label">营业执照注册号（扫描件）</label>
                <div class="col-3 j_fileUpload">
                    <div class="static fl">
                        <a class="j_fileUrl"></a>
                    </div>
                    <div class="file_select">
                        <div class="static">
                            <a class="btn btn-small btn-primary j_fileTxt" data-txt="上传文件">上传文件</a>
                            <input class="txt_file j_fileSelect" name="files" type="file" id="number_info">
                            <input class="j_name" type="hidden" id="number_img_name">
                            <input class="j_url" type="hidden" id="number_img_url">
                            <input class="j_md5" type="hidden" id="number_img_md5">
                            <input class="j_thumbUrl" type="hidden" id="number_img_thumbUrl">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label">备案资质</label>
                <div class="col-10">
                    <table class="table">
                        <thead>
                        <tr>
                            <th width="40%">备案级别</th>
                            <th>资质附件</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td class="j_area">
                                <label class="checkbox-label">
                                    <input id="qualifiedNDRC" class="j_certified" type="checkbox">
                                    发改委备案
                                </label>
                            </td>
                            <td class="j_fileUpload" style="position: relative;">
                                <div class="mask mask-transparent"></div>
                                <div class="static fl">
                                    <a class="j_fileUrl"></a>
                                </div>
                                <div class="file_select">
                                    <div class="static">
                                        <a class="text-disabled j_fileTxt" data-txt="上传文件">上传文件</a>
                                        <input class="txt_file j_fileSelect" name="files" type="file" id="fgw_info">
                                        <input class="j_name" type="hidden" id="fgw_img_name">
                                        <input class="j_url" type="hidden" id="fgw_img_url">
                                        <input class="j_md5" type="hidden" id="fgw_img_md5">
                                        <input class="j_thumbUrl" type="hidden" id="fgw_img_thumbUrl">
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="j_area">
                                <label class="checkbox-label">
                                    <input id="qualifiedMIIT" class="j_certified" type="checkbox">
                                    工信部推荐
                                </label>
                            </td>
                            <td class="j_fileUpload" style="position: relative;">
                                <div class="mask mask-transparent"></div>
                                <div class="static fl">
                                    <a class="j_fileUrl"></a>
                                </div>
                                <div class="file_select">
                                    <div class="static">
                                        <a class="text-disabled j_fileTxt" data-txt="上传文件">上传文件</a>
                                        <input class="txt_file j_fileSelect" name="files" type="file" id="gxb_info">
                                        <input class="j_name" type="hidden" id="gxb_img_name">
                                        <input class="j_url" type="hidden" id="gxb_img_url">
                                        <input class="j_md5" type="hidden" id="gxb_img_md5">
                                        <input class="j_thumbUrl" type="hidden" id="gxb_img_thumbUrl">
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="j_area">
                                <label class="checkbox-label">
                                    <input id="qualifiedP" class="j_certified" type="checkbox">
                                    省级
                                </label>
                                <select id="province_record_id" class="form-control j_areaSelect" disabled>
                                    <option value="">请选择</option>
                                    @forelse ($province_list as $key=>$value)
                                        <option value="{{$value['id']}}">{{$value['name']}}</option>
                                    @empty
                                    @endforelse
                                </select>
                            </td>
                            <td class="j_fileUpload" style="position: relative;">
                                <div class="mask mask-transparent"></div>
                                <div class="static fl">
                                    <a class="j_fileUrl"></a>
                                </div>
                                <div class="file_select">
                                    <div class="static">
                                        <a class="text-disabled j_fileTxt" data-txt="上传文件">上传文件</a>
                                        <input class="txt_file j_fileSelect" name="files" type="file" id="province_info">
                                        <input class="j_name" type="hidden" id="province_img_name">
                                        <input class="j_url" type="hidden" id="province_img_url">
                                        <input class="j_md5" type="hidden" id="province_img_md5">
                                        <input class="j_thumbUrl" type="hidden" id="province_img_thumbUrl">
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="j_area">
                                <label class="checkbox-label">
                                    <input id="qualifiedC" class="j_certified" type="checkbox">
                                    市级
                                </label>
                                <select class="form-control j_areaSelect" disabled id="record_province_list">
                                    <option value="">请选择</option>
                                    @forelse ($province_list as $key=>$value)
                                        <option value="{{$value['id']}}">{{$value['name']}}</option>
                                    @empty
                                    @endforelse
                                </select>
                                <select id="city_record_id" class="form-control j_areaSelect" disabled>
                                    <option value="">请选择</option>
                                </select>
                            </td>
                            <td class="j_fileUpload" style="position: relative;">
                                <div class="mask mask-transparent"></div>
                                <div class="static fl">
                                    <a class="j_fileUrl"></a>
                                </div>
                                <div class="file_select">
                                    <div class="static">
                                        <a class="text-disabled j_fileTxt" data-txt="上传文件">上传文件</a>
                                        <input class="txt_file j_fileSelect" name="files" type="file" id="city_info">
                                        <input class="j_name" type="hidden" id="city_img_name">
                                        <input class="j_url" type="hidden" id="city_img_url">
                                        <input class="j_md5" type="hidden" id="city_img_md5">
                                        <input class="j_thumbUrl" type="hidden" id="city_img_thumbUrl">
                                    </div>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="row">
                <label class="col-2 control-label">单位Banner</label>
                <div class="col-10 j_fileUpload">
                    <div class="static fl">
                        <a class="j_fileUrl"></a>
                    </div>
                    <div class="file_select">
                        <div class="static">
                            <a class="btn btn-small btn-primary j_fileTxt" data-txt="上传文件">上传文件</a>
                            <input class="txt_file j_fileSelect" name="files" type="file" id="banner_info">
                            <input class="j_name" type="hidden" id="banner_img_name">
                            <input class="j_url" type="hidden" id="banner_img_url">
                            <input class="j_md5" type="hidden" id="banner_img_md5">
                            <input class="j_thumbUrl" type="hidden" id="banner_img_thumbUrl">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label">单位简介</label>
                <div class="col-10">
                    <textarea id="company_desc" class="form-control form-control-text"></textarea>
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label">技术专长</label>
                <div class="col-10">
                    <input id="main_tech_desc" class="form-control" size="60" type="text">
                </div>
            </div>
            <div class="row">
                <label class="col-1 control-label">技术优势</label>
                <div class="col-10">
                    <textarea id="tech_success_desc" class="form-control form-control-text" placeholder="介绍"></textarea>
                </div>
            </div>
            <div class="row">
                <div class="col-offset-1 col-10">
                    <a class="btn btn-warning j_companySave" data-chk="2">提交认证</a>
                </div>
            </div>
        </div>
    </div>
</div>


<input id="j_domainIds" type="hidden" value="">
<input id="j_techPathIds" type="hidden" value="">

<div id="j_domainModal"></div>
<div id="j_pathModal"></div>

@endsection

@section('script')
<script src="{{env('STATIC_PATH')}}/libs/datetimepicker.js"></script>
<script src="{{env('STATIC_PATH')}}/libs/ajaxfileupload.js"></script>
<script src="{{env('STATIC_PATH')}}/js/user_company2.js"></script>
<script type="text/javascript">
    $("#company_name").on('blur',function(){
        var company_name = $(this).val();
            $.ajax({
                url:'/company_name_auth',
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                data: {
                    companyName:company_name
                },
                type: 'post',
                dateType: 'json',
                success:function(data){
                    var result = JSON.parse(data);
                    if (result.result == 1) {
                        $("#company_exists_area").show();
                        $("#company_exists_url").attr('href','/company_info?id='+result.company_id);
                    }else{
                        $("#company_exists_area").hide();
                    }
                }

            })
    });
    //设置领域
    $(".j_setDomain").click(function(){
        var $modal = $('#j_domainModal');
        if (!$modal.find('.modal').length) {
            $.get('/add_company_info_domain_page', function (data) {
                $modal.html(data).css('display', 'block');
            }, 'html');
        } else {
            $modal.css('display', 'block');
        }
    });

    //设置技术路径
    $(".j_setPath").click(function(){
        if (!$('#j_domainIds').val()) {
            return showErr($('.j_setDomain'), '请先设置涉及领域');
        }
        var $modal = $('#j_pathModal');
        var domainIdsData = $("#j_domainIds").val();
        if (!$modal.find('.modal').length) {
            $.get('/add_company_info_tech_path',{domain:domainIdsData}, function (data) {
                $modal.html(data).css('display', 'block');
            }, 'html');
        } else {
            $modal.css('display', 'block');
        }
    });

    //关闭模态框
    $('#j_domainModal,#j_pathModal').on('click', '.close', function () {
        $(this).parents('.modal').parent().fadeOut(200);
    });
</script>
@endsection
